package com.zscat.mallplus.pms.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.pms.entity.PmsComment;
import com.zscat.mallplus.pms.entity.PmsCommentReport;
import com.zscat.mallplus.pms.service.IPmsCommentReportService;
import com.zscat.mallplus.utils.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: rwz
 * @Date: 2020/10/27/10:21 下午
 * @Description:
 */
@Slf4j
@RestController
@Api(tags = "PmsCommentReportController", description = "举报管理")
@RequestMapping("/pms/PmsCommentReport")
public class PmsCommentReportController {

    @Resource
    private IPmsCommentReportService commentReportService;

    @SysLog(MODULE = "pms", REMARK = "商品评价举报列表")
    @ApiOperation("商品评价举报列表")
    @GetMapping(value = "list")
    public Object list(PmsCommentReport commentReport,
                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
        return new CommonResult().success(commentReportService.page(new Page<PmsCommentReport>(pageNum, pageSize), new QueryWrapper<>(commentReport).orderByDesc("create_time")));
    }
}

